aboutsummaryrefslogtreecommitdiff
path: root/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
blob: e7895b2dcae3a86459b4e70994701a6e5f997943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Compilation unit elements:

(
    function
    "shed__function__f__0"
    visibility=private
    locals=((param "closurePointer__0" data-ptr) (val "local__a" data-ptr) (val "local__b" data-ptr))
    return-type=int
    body=(
        (
            memory-load
            (local "local__a")
            pointer=(local "closurePointer__0")
            layout=(struct (function-ptr (struct (data-ptr data-ptr))))
            offset=(1 0)
        )
        (
            memory-load
            (local "local__b")
            pointer=(local "closurePointer__0")
            layout=(struct (function-ptr (struct (data-ptr data-ptr))))
            offset=(1 1)
        )
        (return (local "local__a"))
    )
)

Locals:
 * (val "local__a" data-ptr)
 * (val "local__b" data-ptr)
 * (val "closure__f__0" int)
 * (val "closurePointer__f__0" data-ptr)

Instructions:

(
    (alloc-heap (local "closurePointer__f__0") (struct (function-ptr (struct (data-ptr data-ptr)))))
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (function-ptr (struct (data-ptr data-ptr))))
        offset=(0)
        value=(function-ptr "shed__function__f__0")
    )
    (data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (function-ptr (struct (data-ptr data-ptr))))
        offset=(1 0)
        value=(local "local__a")
    )
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (function-ptr (struct (data-ptr data-ptr))))
        offset=(1 1)
        value=(local "local__b")
    )
)

Temporary stack:
 * PatioLocalRef[name=closure__f__0]